<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="jquery.js" type="text/javascript"></script>
<script>
function bodyLoad() {
	var url = "http://t.trenddata.cn/back-end/auth.php";
	$.post(url, function(data) {
	    if (data == 'success') {
	        $("#p4p_content").load("http://t.trenddata.cn/back-end/menu.php");
	    } else {
	    	$("#p4p_content").load("login.html");
	    }
	});
}

function submitForm() {
	var url = "http://t.trenddata.cn/back-end/auth.php";
	var params = {
        loginname:$("#loginname").val(),
        password:$("#password").val()
	}
	$.post(url, params, function(data) {
        if (data == "success") {
            $("#p4p_content").load("http://t.trenddata.cn/back-end/menu.php");
        } else if (data == "error_password") {
            alert("用户名或者密码不对");
        } else if (data == "error_status") {
            alert("帐户未激活");
        } else if (data == "expired") {
            alert("帐户已过期，请续费");
        } else {
        	alert("登录失败");
        }
	});
    return false;
}
</script>
<body onload="bodyLoad()">
    <div id="p4p_content">
        <!-- <form id="loginform" action="http://t.trenddata.cn/back-end/auth.php" method="post" onsubmit="return submitForm();">
            <span class="txt">用户：</span>
            <span class="ipt"><input type="text" id="loginname" name="loginname" value=""/></span>
            <span class="txt">密码：</span>
            <span class="ipt"><input type="password" id="password" name="password" value="" /></span>
            <span class="btn"><input type="submit" value="登录" /></span>
        </form> -->
    </div>
</body>